#!/bin/sh
# 1 file 2 dir

rm -rvf `pwd|find -iname "*~"`
rm -rvf `pwd|find -iname ".*.swp"`
rm -rvf `pwd|find -iname ".*.swo"`

if [[ -f "$1" ]]; then
	sudo chown http:http $1
	sudo chmod 664 $1
elif [[ -d "$1" ]]; then 
	sudo chown -R http:http $1
	sudo chmod 775 -R $1
	find $1 -iname '*' | [[ -f "$1" ]] && chmod 775 "$1" 
else 
	sudo chown http:http *.$1
	sudo chmod 664 *.$1
fi


